package com.gears_software.bbnetwork.dialogs;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.gears_software.bbnetwork.R;
import com.gears_software.bbnetwork.datas.models.InputTixianPwdModel;

public class InputPwsOrResultDialog extends Dialog {

	InputTixianPwdModel model;
	public InputPwsOrResultDialog(Context context, int theme,InputTixianPwdModel model) {
		super(context, theme);
		this.model = model;
	}
	
	TextView text_yinhang;//银行名称信息
	TextView text_Amount;//提现金额
	EditText dialong_edit;//输入密码
	Button btn_submit;//提交
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		setContentView(R.layout.activity_tixiandialog);
		text_yinhang = (TextView) findViewById(R.id.text_yinhang);
		text_Amount = (TextView) findViewById(R.id.text_Amount);
		dialong_edit = (EditText) findViewById(R.id.dialong_edit);
		btn_submit = (Button) findViewById(R.id.btn_submit);
		
		if(model!=null){
			String amount  = model.getCardNum().substring(model.getCardNum().length()-4,model.getCardNum().length());
			text_yinhang.setText("转出到"+model.getCardName()+"储蓄卡("+amount+")");
			text_Amount.setText("￥"+model.getAmount());
		}
		
		btn_submit.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				String pwd = dialong_edit.getText().toString();
				irResultClick.returnData(model.getAmount(), pwd);
			}
		});
	}
	
	public interface IResultClick{
		public void returnData(String amount,String pwd);
	}
	
	private IResultClick irResultClick = null;
	
	public void setIResultClick(IResultClick irResultClick){
		this.irResultClick = irResultClick;
	}
	

}
